#pragma once
#ifndef CHART_H__
#define CHART_H__
#include "../common/Axis.h"
#include "../../gui/GlobalChartOptions/GlobalChartOptions.h"
#include <vector>
#include <QColor>
#include <boost/version.hpp>
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <boost/serialization/extended_type_info.hpp>
#include <boost/serialization/base_object.hpp>
namespace LightChart
{
class Chart
{
public:
    Chart(std::string title = "", const unsigned windowWidth = 0, const unsigned windowHeight = 0)
        : title(title), windowWidth(windowWidth), windowHeight(windowHeight), bgColor(0,0,0) {}
    virtual ~Chart() {}
    virtual void draw() = 0;
    virtual void showOptions() = 0;
    virtual std::vector<Axis*> get_axes() = 0;
    void setWindowWidth(const unsigned);
    void setWindowHeight(const unsigned);
    void setTitle(const std::string);
    const std::string & get_title() const { return title; }
    void setBgColor(int r, int g, int b) { bgColor.setRgb(r,g,b); }
    void setBgColor(QColor c) { bgColor = c; }
    const QColor& getBgColor() const { return bgColor; }
    const unsigned& getWindowWidth() const { return windowWidth; }
    const unsigned& getWindowHeight() const { return windowHeight; }
protected:
    std::string title;
    unsigned windowWidth;
    unsigned windowHeight;
    QColor bgColor;
private:
    friend class boost::serialization::access;
    template<class Archive> void serialize(Archive & ar, const unsigned int version);
};
template<class Archive> inline void Chart::serialize(Archive & ar, const unsigned int) {
    ar & title;
    ar & windowWidth;
    ar & windowHeight;
    //ar & bgColor; @TODO implement this shit
}
} /* LightChart */
#if BOOST_VERSION > 104200
#else
BOOST_CLASS_EXPORT(LightChart::Chart)
#endif
#endif /* CHART_H__ */
